package com.edu.exam.enums.examination;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 扫描仪连接类型枚举
 */
@Getter
@AllArgsConstructor
public enum ScannerConnectionType {
    USB("USB", "USB连接"),
    USB_C("USB_C", "USB-C连接"),
    ETHERNET("ETHERNET", "以太网连接"),
    WIFI("WIFI", "无线网络"),
    BLUETOOTH("BLUETOOTH", "蓝牙连接"),
    FIREWIRE("FIREWIRE", "火线接口"),
    SCSI("SCSI", "SCSI接口"),
    SERIAL("SERIAL", "串口连接"),
    PARALLEL("PARALLEL", "并口连接"),
    TWAIN("TWAIN", "TWAIN协议"),
    ISIS("ISIS", "ISIS协议"),
    WIA("WIA", "WIA协议");

    private final String code;
    private final String description;

    public static ScannerConnectionType fromCode(String code) {
        for (ScannerConnectionType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return USB; // 默认返回USB连接
    }
}